#include "query.h"

Query::Query(string name)
{
	this->name = name;
}

void Query::add_feature(string fea, double val)
{
	this->feature.insert(pair<string, double>(fea, val));
}

double Query::distace(Query &query1, Query &query2)
{
	map<string, double> &f_set_1 = query1.feature;
	map<string, double> &f_set_2 = query2.feature;
	map<string, double>::iterator itr;
	for(itr = f_set_1.begin(); itr != f_set_1.end(); ++ itr)
		if(f_set_2.find((*itr).first) != f_set_2.end())
			return 0;
	return 1;
}